layui.use(['element', 'form', 'table'], function(){
    var element = layui.element;
    var form = layui.form;
    var table = layui.table;
    var $ = layui.$;

    //图标配置文件
    var optsIcon = {
        "0": "./image/w.png",
        '1': "./image/cny.png",
        '2': "./image/USDT.png",
        '3': "./image/btc.png",
        '4': "./image/ETH.png"
    }
    // 初始化图标
    var iconG = new Image()
    iconG.src = optsIcon[1]
    iconG.style.position = "absolute"
    iconG.style.top = "11px"
    iconG.style.left = "10px"
    $('#country input').before(iconG)

    form.on('select(country)', function (res) {

        var opts = {
            "WTL": "./image/w.png",
            'CNY': "./image/cny.png",
            'USDT': "./image/USDT.png",
            'BTC': "./image/btc.png",
            'ETH': "./image/ETH.png"
        }
        data.selectType = res.value

        iconG.src = opts[res.value]
        $('#country input').before(iconG)
    })



    $('#country .layui-anim.layui-anim-upbit').find('dd').each(function (index, item) {

        var img = new Image()
        img.src = optsIcon[index]
        img.style.marginRight="10px"

        $(item).prepend(img)
    })
});
var data = {
    selectType: "CNY"
}
var main = new Vue({
    el: '#main',
    data: data
})


